home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
restaurante_1072.swf
/
scripts
/
__Packages
/
PathFinding.as
< prev
next >
Wrap
Text File
|
2009-04-16
|
4KB
|
93 lines
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(!_global.PathFinding)
{
var _loc2_ = _global.PathFinding = function()
{
}.prototype;
_global.PathFinding = function()
{
}.getPathToTable = function(t2)
{
return PathFinding.getPathBetweenTables(Table.getTableByIJ(0,0),t2);
};
_global.PathFinding = function()
{
}.getPathFromTable = function(t1)
{
var _loc1_ = [];
var _loc2_ = Table.getTableByIJ(0,0);
_loc1_ = PathFinding.getPathBetweenTables(t1,_loc2_);
var _loc4_ = !(t1.__get__RowNum().i != _loc2_.__get__RowNum().i && t1.__get__RowNum().j != _loc2_.__get__RowNum().j) ? _loc2_ : (t1.__get__rendezvousPoint().x >= _loc2_.__get__rendezvousPoint().x ? Table.getTableByIJ(_loc2_.__get__RowNum().i,t1.__get__RowNum().j) : Table.getTableByIJ(t1.__get__RowNum().i,_loc2_.__get__RowNum().j));
if(_loc4_ == t1)
{
_loc1_.pop();
_loc1_.push(_loc4_.__get__rendezvousPoint());
}
else if(_loc4_ == _loc2_)
{
_loc1_.pop();
_loc1_.push(_loc4_.__get__rendezvousPoint());
}
else
{
_loc1_.pop();
_loc1_.pop();
_loc1_.push(_loc2_.__get__rendezvousPoint());
}
return _loc1_;
};
_global.PathFinding = function()
{
}.getPathBetweenTables = function(t1, t2)
{
if(PathFinding.isSameTable(t1,t2))
{
return [t1.__get__rightPoint(),t1.__get__arrivePoint()];
}
var _loc4_ = [];
var _loc2_ = !(t1.__get__RowNum().i != t2.__get__RowNum().i && t1.__get__RowNum().j != t2.__get__RowNum().j) ? t2 : (t1.__get__rendezvousPoint().x >= t2.__get__rendezvousPoint().x ? Table.getTableByIJ(t2.__get__RowNum().i,t1.__get__RowNum().j) : Table.getTableByIJ(t1.__get__RowNum().i,t2.__get__RowNum().j));
_loc4_.push((t1.__get__arrivePoint().x - _loc2_.__get__arrivePoint().x) * (t1.__get__arrivePoint().y - _loc2_.__get__arrivePoint().y) <= 0 ? t1.__get__leftPoint() : t1.__get__rightPoint());
if(t2 == _loc2_)
{
_loc4_.push((t1.__get__arrivePoint().x - _loc2_.__get__arrivePoint().x) * (t1.__get__arrivePoint().y - _loc2_.__get__arrivePoint().y) <= 0 ? _loc2_.__get__leftPoint() : _loc2_.__get__rightPoint());
_loc4_.push(_loc2_.__get__arrivePoint());
}
else
{
_loc4_.push(_loc2_.__get__rendezvousPoint());
_loc4_.push((t2.__get__arrivePoint().x - _loc2_.__get__arrivePoint().x) * (t2.__get__arrivePoint().y - _loc2_.__get__arrivePoint().y) <= 0 ? t2.__get__leftPoint() : t2.__get__rightPoint());
_loc4_.push(t2.__get__arrivePoint());
}
return _loc4_;
};
_global.PathFinding = function()
{
}.isSameTable = function(t1, t2)
{
return t1.__get__rendezvousPoint().x == t2.__get__rendezvousPoint().x && t1.__get__rendezvousPoint().y == t2.__get__rendezvousPoint().y;
};
§§push(ASSetPropFlags(_global.PathFinding.prototype,null,1));
}
§§pop();
}
}
§§goto(addr425);
}
}
addr425: